package com.luhuiguo.sso.web.pages.secure.admin;

import org.apache.tapestry5.PersistenceConstants;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.luhuiguo.sso.service.PropertyManager;

public class Setting {

	@Inject
	private PropertyManager propertyManager;

	@Inject
	private Messages messages;

	@SuppressWarnings("unused")
	@Property
	@Persist(PersistenceConstants.FLASH)
	private String message;

	public PropertyManager getPropertyManager() {
		return propertyManager;
	}

	@OnEvent(value = "success", component = "setting")
	Object onSuccessFromSetting() {
		message = messages.get("setting-saved");
		return null;
	}

}
